// pages/home/home.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    imgUrls: [
      'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg',
      'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg',
      'http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg'
    ],
    indicatorDots: true,
    autoplay: false,
    interval: 5000,
    duration: 1000,
    value:"",
    listData:[
      {
        "id": 1,
        "name": "纸短情长",
        "title": "《纸短情长》是由言寺作词、作曲，张梓洋编曲，烟把儿乐队演唱的一首歌曲。这首歌主要表达的是对以前感情的纪念，也是对未来生活的美好期待",
        "imgUrl": "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg"
      },
      {
        "id": 2,
        "name": "扶摇",
        "title": "《扶摇》是根据天下归元小说《扶摇皇后》改编的古装女性励志电视剧",
        "imgUrl": "https://y.gtimg.cn/music/photo_new/T002R300x300M000002Gh03A1VuYva.jpg",
        "src": "http://dl.stream.qqmusic.qq.com/C4000023Qbez4cYBIQ.m4a?vkey=86AED6401E6125AE6AA42E108081B12CC555D8854255A656DFB8BFC8498A01E29A28DFA4F2C0BA236132C1B342167B32DFE51612D27B542D&guid=4935924390&uin=756563810&fromtag=66"
      },
      {
        "id": 3,
        "name": "天使的翅膀",
        "title": "专辑：李雷和韩梅梅",
        "imgUrl": "https://y.gtimg.cn/music/photo_new/T002R300x300M000000UuFDA0ukgW6.jpg",
        "src": "http://dl.stream.qqmusic.qq.com/C400000tuhO51YoR2M.m4a?vkey=E94AF85AAF00F01E8CA58AA4B1CD182A6254FB26E27DED0D8BAD0602F7D52FC3C827304BA6B1B1A5EA32718DD5F336756EAB3B299F474300&guid=4935924390&uin=756563810&fromtag=66"
      },
      {
        "id": 4,
        "name": "情非得已",
        "title": "专辑：李雷和韩梅梅",
        "imgUrl": "https://y.gtimg.cn/music/photo_new/T002R300x300M0000047vEep0eTkcJ.jpg?max_age=2592000",
        "src": "http://dl.stream.qqmusic.qq.com/C400000yViT11bFnD4.m4a?vkey=78C74E68217FF80653F5769E1C2B6C18454855479B14E815177C2A2EE58C7665801D650E39216493B84C76497C0909EFA7BB9A7830B38AE0&guid=4935924390&uin=756563810&fromtag=66"
      },
      {
        "id": 5,
        "name": "传奇",
        "title": "王菲",
        "imgUrl": "https://y.gtimg.cn/music/photo_new/T002R300x300M000002jYUVQ3I0XyX.jpg?max_age=2592000",
        "src": "http://dl.stream.qqmusic.qq.com/C400002twZxX087cPx.m4a?vkey=08FAA30069368C88DA77950B335F7E304387A5F8C6193723E3C54379C60A1222867759F785712696F1AC067D74377A69A5F5D570F973275A&guid=4935924390&uin=756563810&fromtag=66"
      },
      {
        "id": 6,
        "name": "红豆",
        "title": "王菲",
        "imgUrl": "https://y.gtimg.cn/music/photo_new/T002R300x300M000003MM0Hs2oZ6vq.jpg?max_age=2592000",
        "src": "http://dl.stream.qqmusic.qq.com/C400004XVgIC3SWmhE.m4a?vkey=62535C9A197911AAD0565C358110C7D3B9079179FC7F70D2E5CC9F237511D4F45042F6072CFB6552480BD541B54DBDE9E556BF0F7AC428AD&guid=4935924390&uin=756563810&fromtag=66"
      },
      {
        "id": 7,
        "name": "痴心绝对",
        "title": "李圣杰",
        "imgUrl": "https://y.gtimg.cn/music/photo_new/T002R300x300M000000UuFDA0ukgW6.jpg",
        "src": "http://dl.stream.qqmusic.qq.com/C400003bVCqX2SRdEW.m4a?vkey=A18BFF40BFCB6573BAC9586CA55ECEF6A5E608DEA358B22B3EEECB012E4A61900ACA2B355D18414059CAA823C2672797790739845613FB55&guid=4935924390&uin=756563810&fromtag=66"
      },
      {
        "id": 8,
        "name": "老男孩",
        "title": "筷子兄弟",
        "imgUrl": "https://y.gtimg.cn/music/photo_new/T002R300x300M000000anHZA2CuwxK.jpg?max_age=2592000",
        "src": "http://dl.stream.qqmusic.qq.com/C400001xXUin4eaeA4.m4a?vkey=C94D07B4C75F93858722E172223158F2EA44042A1EBE6545FB58C90805718B1A3FF9ED6744C83A301AC4D33A972FCAE361A2FBCE2D068F80&guid=4935924390&uin=756563810&fromtag=66"
      },
      {
        "id": 9,
        "name": "十年",
        "title": "陈奕迅",
        "imgUrl": "https://y.gtimg.cn/music/photo_new/T002R300x300M000000GDz8k03UOaI.jpg?max_age=2592000",
        "src": "http://dl.stream.qqmusic.qq.com/C400001OyHbk2MSIi4.m4a?vkey=669BFD8826DF67D6B52A24FA1219F15DD71E2407C596AFB9D5F491779C77DA32B8EFA8E19D3D901264B259190A5064CD14D0DEDC8E39267B&guid=4935924390&uin=756563810&fromtag=66"
      },
      {
        "id": 10,
        "name": "断点",
        "title": "张敬轩",
        "imgUrl": "https://y.gtimg.cn/music/photo_new/T002R300x300M000001P8Ajd0ibC7q.jpg?max_age=2592000",
        "src": "http://dl.stream.qqmusic.qq.com/C400002mASQc3pH9Hx.m4a?vkey=E7E0B0493C13BBAA643EEA152B0E1873657D22B5001BB18FE34E1E8074BDED052558B3BF6ECAD36BA05E0755B163592F2D7C4EF7BE781BDD&guid=4935924390&uin=756563810&fromtag=66"
      }
    ],
    isChecked: 1 ,   //导航栏样式
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    wx.request({
      url: 'http://www.easy-mock.com/mock/5b30a81cca97020a6a55992a/wxmusic/homesearch', //仅为示例，并非真实的接口地址
      data: {
       
      },
      header: {
        'content-type': 'application/json' // 默认值
      },
      success: function (res) {
        console.log(res.data)
      }
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  },
  //跳转页面
  toPage:function(v){
    console.log(v.currentTarget.dataset.v.id);
    wx.navigateTo({
      //url: '../detail/detail'
      url: '../simpleDetail/simpleDetail?id=' + v.currentTarget.dataset.v.id
    })
  },
  //选择样式
  his(n){
    this.setData({
      isChecked: n.currentTarget.dataset.id
    })  
  },
  //搜索
  search:function(){
    console.log("搜索" + this.value);
     wx.navigateTo({
       url: '../searchres/searchres?value=' + this.value
     })
    //  wx.showToast({
    //    title: '暂无此信息',
    //    icon: 'none',
    //    duration: 2000
    //  });
  }
})